package com.cyzy.server.dao;

import com.cyzy.pojo.entity.Superintendent;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SuperintendentDao {

    /**
     * 根据学生学号查询密码
     * @param studentId
     * @return
     */
    @Select("select * from superintendent where student_id = #{studentId}")
    Superintendent getByStudentId(String studentId);

    /**
     * 根据手机号查询密码
     * @param phoneNumber
     * @return
     */
    @Select("select * from superintendent where phone = #{phoneNumber}")
    Superintendent getByPhoneNumber(String phoneNumber);

    /**
     * 将数据插入管理者的表中
     */
    @Insert("insert into superintendent (student_id, username, school, password, phone, sex, create_time, update_time, create_user, update_user, status) " +
            "values (#{studentId}, #{name}, #{school}, #{password}, #{phone}, #{sex}, #{createTime}, #{updateTime}, #{createUser}, #{updateUser}, #{status})")
    void insert(Superintendent superintendent);


}
